#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "ui_MainWindow.h"
#include <triangle.h>

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget* parent = 0);

    void putPixel(const QPoint& point, const QColor& color = Qt::black);
    void drawLine(const QPoint& point1, const QPoint& point2, const QColor& color = Qt::black);
    void drawTriangle(QPoint point1, QPoint point2, QPoint point3, const QColor& color = Qt::black);
    void drawHalfTriangle(int x0, int xf, double m1, double m2, double b1, double b2, const QColor& color);
    void paint();

public slots:
    void adicionarTriangulo();
    void wireframeClicked(bool);
    void rasterizeClicked(bool);


private:
    Ui::MainWindow ui;

    QImage buffer;
    const int pixelZoom;

    bool wireframe;
    bool rasterize;
    QList<Triangle> triangulos;

};

#endif // MAINWINDOW_H
